<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>在div左上角绘制一个标签</title>
    <style>
        .card{
            background-color: #f1f1f1;
            width: 200px;
            height: 100px;
            position: relative;
            overflow: hidden;   /*关键：隐藏标签多余的部分*/
        }

        .label{
            position: absolute; /*关键：标签采用绝对布局定位在左上角*/
            left: 0;
            top: 0;
            background-color: #FF9800;
            line-height: 30px;
            width: 80px;
            text-align: center;
            transform-origin: right bottom;
            transform: translate(-29.29%,-100%) rotate(-45deg);
        }
    </style>
</head>

<body>

    <div class="card">

        <div class="label">标签</div>
    </div>


</body>

</html>